using System;
using System.Collections;
using System.Collections.Generic;
using GTA;
using MotionFramework;
using MotionFramework.Audio;
using UnityEngine;

namespace offline2048
{
    public class StartRoot : MonoBehaviour
    {
        void Awake()
        {
            //UserLayerManager.Instance.ChangeUserLayerByGM(UserLayerManager.UserLayerType.Organic);
            /*AdWrapper.Instance.Init();
            ADSHelper.Instance.Init();
            ConfigManager.Instance.Init();
            MainManager.Instance.m_OpenInterCMTime = 99999;
            // 创建音频管理器
            MotionEngine.CreateModule<AudioManager>();*/
        }

        void Start()
        {
            if (Application.platform == RuntimePlatform.IPhonePlayer)
            {
                int curStatus = ATTAuth.GetAppTrackingAuthorizationStatus();
                if(curStatus == 0)
                {
                    ATTAuth.RequestTrackingAuthorizationWithCompletionHandler((status) =>
                    {
                        GameLogger.Error("ATT status :===============" + status);
                    });
                }
            }
            
            AdWrapper.Instance.Init();
            ADSHelper.Instance.Init();
            ConfigManager.Instance.Init();
            AdjustWrapper.Instance.Init();
            MainManager.Instance.InitIapMgr();
            MainManager.Instance.m_TouchCount = 0;
            MainManager.Instance.m_TouchCountTime = 0;
            MainManager.Instance.m_OpenInterCMTime = 99999;
            // 创建音频管理器
            MotionEngine.CreateModule<AudioManager>();
        }
    }
}


